package com.ck.springboot.controller;



import com.ck.springboot.lock.annotation.CacheLock;
import com.ck.springboot.lock.annotation.CacheParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * @ClassName BookController
 * @Description
 * @Author admin
 * @Date 2019/7/15 17:49
 **/
@RestController
@RequestMapping("/books")
public class BookController {

    @CacheLock(prefix = "books")
    @GetMapping
    public String query(@CacheParam(name = "token") @RequestParam String token) {
        return "success - " + token;
    }
}
